close all
clear
clc
hours=xlsread('HoursConstruction_v2021','H17:H308');
tt=1948:.25:2020.75;
z=4;
xx=(1:length(hours))';XX=[];
for i=z:-1:1
   XX=[XX,xx.^i]; 
end
XX=[XX,ones(length(hours),1)];
p=polyfit((1:length(hours))',hours,z);
yy=XX*p';

figure
plot(tt,hours)
hold on
plot(tt,yy,'--r')
hold off
axis tight

gapFullSample=hours-yy;
gap=gapFullSample(find(tt==1959.25):end);